package com.bw.product.controller;

import com.bw.common.core.domain.Result;
import com.bw.common.security.annotation.RequiresPermissions;
import com.bw.product.domain.vo.ItemInfoVo;
import com.bw.product.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.ExecutionException;

/**
 * 查询商品详情
 */
@RestController
@RequestMapping("/item")
public class ItemController {
    @Autowired
    private ItemService itemServer;

    /**
     * 根据skuId查询商品详情
     * @param skuId
     * @return
     */
//    @RequiresPermissions("product:item:list")
    @GetMapping("/findItemInfoBySkuId")
    public Result<ItemInfoVo> findItemInfoBySkuId(@RequestParam Long skuId) throws ExecutionException, InterruptedException {
        return Result.success(itemServer.findItemInfoBySkuId(skuId));
    }







}
